//
//  TeacherListTableViewCell.swift
//  DriverSchoolAPP
//
//  Created by Logel on 2017/5/18.
//  Copyright © 2017年 Logel. All rights reserved.
//

import UIKit

class TeacherListTableViewCell: UITableViewCell {
    @IBOutlet weak var headImg: UIImageView!
    @IBOutlet weak var nameLbl: UILabel!
    @IBOutlet weak var placeLbl: UILabel!
    
    
    var starView:GYSStarLevelView = GYSStarLevelView()
    override func awakeFromNib() {
        super.awakeFromNib()
        headImg.layer.cornerRadius = headImg.frame.size.width/2
        let starView = GYSStarLevelView.init(frame:CGRect(x: 210, y: 0,width: 100, height: 20))
        self.addSubview(starView)
        starView.settingMaxValue(max: 5.0)
        starView.setFontSize(fontSize: 20)
        self.starView = starView
        

        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    var to:TeacherOne!{
        didSet{
            nameLbl.text = to.name
            starView.settingHighlightValue(highlight: CGFloat(Float(to.star)!))
            placeLbl.text = to.placeName
            headImg.image = to.picture == "" ? UIImage(named:"1.jpg"):getImageWithUrl(url:to.picture )
        }
    }

}
